
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>4.2TableEvaluator · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../5zhong-zi-guan-li-qi.html" />
    
    
    <link rel="prev" href="41sipsoup.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    序言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1.html">
            
                <a href="../chapter1.html">
            
                    
                    1. 快速入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../2ji-ben-zu-jian.html">
            
                <a href="../2ji-ben-zu-jian.html">
            
                    
                    2.基本组件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../2ji-ben-zu-jian/processor.html">
            
                <a href="../2ji-ben-zu-jian/processor.html">
            
                    
                    2.1 Processor
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../2ji-ben-zu-jian/22-pipline.html">
            
                <a href="../2ji-ben-zu-jian/22-pipline.html">
            
                    
                    2.2 Pipline
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../2ji-ben-zu-jian/23-sessionpool.html">
            
                <a href="../2ji-ben-zu-jian/23-sessionpool.html">
            
                    
                    2.3 SessionPool
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../3pa-chong-kong-zhi.html">
            
                <a href="../3pa-chong-kong-zhi.html">
            
                    
                    3.爬虫控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../4chou-qu-qi.html">
            
                <a href="../4chou-qu-qi.html">
            
                    
                    4.抽取器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="41sipsoup.html">
            
                <a href="41sipsoup.html">
            
                    
                    4.1SipSoup
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.2" data-path="42tableevaluator.html">
            
                <a href="42tableevaluator.html">
            
                    
                    4.2TableEvaluator
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../5zhong-zi-guan-li-qi.html">
            
                <a href="../5zhong-zi-guan-li-qi.html">
            
                    
                    5.种子管理器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../6shi-jian-xun-huan.html">
            
                <a href="../6shi-jian-xun-huan.html">
            
                    
                    6.事件循环
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.html">
            
                <a href="../6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.html">
            
                    
                    6.1 eventLoop工作机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../6shi-jian-xun-huan/62zi-dong-shi-jian.html">
            
                <a href="../6shi-jian-xun-huan/62zi-dong-shi-jian.html">
            
                    
                    6.2 自动事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../6shi-jian-xun-huan/63delayevent.html">
            
                <a href="../6shi-jian-xun-huan/63delayevent.html">
            
                    
                    6.3 延时事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../6shi-jian-xun-huan/64classScanner.html">
            
                <a href="../6shi-jian-xun-huan/64classScanner.html">
            
                    
                    6.4 classScanner
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >4.2TableEvaluator</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x8868;&#x683C;&#x6570;&#x636E;&#x62BD;&#x53D6;&#x76EE;&#x524D;&#x662F;VS&#x72EC;&#x6709;&#x7684;&#xFF0C;&#x8BBE;&#x8BA1;&#x4ED6;&#x7684;&#x539F;&#x56E0;&#x662F;&#x53D1;&#x73B0;&#x5F88;&#x591A;&#x7F51;&#x7AD9;&#x7684;&#x8868;&#x683C;&#x5E76;&#x4E0D;&#x597D;&#x63D0;&#x53D6;&#xFF0C;&#x56E0;&#x4E3A;&#x4ED6;&#x4EEC;&#x5C31;&#x662F;&#x7EAF;&#x7CB9;&#x7684;&#x8868;&#x683C;&#xFF0C;&#x6CA1;&#x6709;css&#x6837;&#x5F0F;&#xFF0C;&#x6CA1;&#x6709;&#x6807;&#x7B7E;ID&#xFF0C;&#x6CA1;&#x6709;&#x7279;&#x70B9;&#x4FE1;&#x606F;&#x3002;&#x8FD9;&#x4E2A;&#x65F6;&#x5019;JSoup&#x5F88;&#x96BE;&#x641E;&#x5B9A;&#xFF0C;xpath&#x5B9E;&#x73B0;&#x8D77;&#x6765;&#x4E5F;&#x633A;&#x590D;&#x6742;&#x7684;&#xFF0C;&#x5BF9;&#x4E8E;xpath&#x53EF;&#x80FD;&#x53EF;&#x4EE5;&#x5B9A;&#x4F4D;&#x5230;&#x6570;&#x636E;&#xFF0C;&#x4F46;&#x4E5F;&#x662F;&#x9700;&#x8981;&#x5199;&#x903B;&#x8F91;&#x5904;&#x7406;&#x6BCF;&#x884C;&#x6BCF;&#x5217;&#x3002;</p>
<p>TableEvaluator&#x4E13;&#x95E8;&#x8BBE;&#x8BA1;&#x7528;&#x6765;&#x89E3;&#x51B3;&#x6B64;&#x7C7B;&#x8003;&#x4F4D;&#x7F6E;&#x786E;&#x5B9A;&#x8282;&#x70B9;&#x542B;&#x4E49;&#x7684;&#x573A;&#x666F;&#x7684;&#x6570;&#x636E;&#x62BD;&#x53D6;&#x3002;&#x5206;&#x5982;&#x4E0B;&#x6B65;&#x9AA4;</p>
<h2 id="tableparser">TableParser</h2>
<p>parse a table data from a document. &#x4ED6;&#x4F1A;&#x5C06;&#x4E00;&#x4E2A;&#x8868;&#x683C;&#x89E3;&#x6790;&#x6210;&#x4E00;&#x4E2A;&#x77E9;&#x9635;&#x7ED3;&#x6784;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x4ED6;&#x4E0D;&#x5149;&#x652F;&#x6301;tr/td&#x6A21;&#x5F0F;&#x7684;&#x6807;&#x51C6;&#x8868;&#x683C;&#xFF0C;&#x8FD8;&#x6307;&#x51FA;ul/li&#x3001;div&#x8FD9;&#x7C7B;&#x7684;&#x5047;&#x8868;&#x683C;&#x1F604;&#x3002;&#x5177;&#x4F53;&#x7684;&#x7528;&#x6CD5;&#x81EA;&#x5DF1;&#x770B;&#x770B;&#x4EE3;&#x7801;&#x5427;</p>
<pre><code class="lang-java">       <span class="hljs-keyword">private</span> String tableSelector;
        <span class="hljs-keyword">private</span> String rowSelector;
        <span class="hljs-keyword">private</span> String columnSelector;
        <span class="hljs-keyword">private</span> Element tableElement;
        <span class="hljs-keyword">private</span> String thSelector;
        <span class="hljs-keyword">private</span> List&lt;Element&gt; tableHeader;
</code></pre>
<p>&#x6709;&#x8FD9;&#x4E9B;&#x53C2;&#x6570;&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#xFF0C;tableSelector&#x662F;&#x8868;&#x683C;&#x5B9A;&#x4F4D;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;rowSelector&#x662F;&#x884C;&#x5B9A;&#x4F4D;&#x8868;&#x8FBE;&#x5F0F;&#xFF08;&#x9ED8;&#x8BA4;&#x662F; &#x201C;tr&#x201D;&#xFF09;&#xFF0C;columnSelector&#x662F;&#x5217;&#x5B9A;&#x4F4D;&#x8868;&#x8FBE;&#x5F0F;&#xFF08;&#x9ED8;&#x8BA4;&#x662F;&#xFF1A;&#x201C;td&#x201D;&#xFF09;&#xFF0C;tableElement&#x662F;&#x8868;&#x683C;&#x5143;&#x7D20;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x5DF2;&#x7ECF;&#x5B9A;&#x4F4D;&#x5230;&#x8868;&#x683C;&#x5143;&#x7D20;&#x4E86;&#xFF0C;&#x90A3;&#x4E48;&#x5C31;&#x4E0D;&#x9700;&#x8981;&#x8868;&#x683C;&#x5B9A;&#x4F4D;&#x8868;&#x8FBE;&#x5F0F;&#x4E86;&#x3002;thSelector&#x662F;&#x8868;&#x5934;&#x5B9A;&#x4F4D;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;&#x5BF9;&#x4E8E;&#x5217;&#x8868;&#x5F62;&#x5F0F;&#x7684;&#x8868;&#x683C;&#x89E3;&#x6790;&#xFF0C;&#x8868;&#x5934;&#x4FE1;&#x606F;&#x4EE3;&#x8868;&#x7740;&#x6BCF;&#x4E2A;&#x5B57;&#x6BB5;&#x7684;&#x542B;&#x4E49;&#xFF0C;&#x6240;&#x4EE5;&#x9700;&#x8981;&#x89E3;&#x6790;&#x8868;&#x5934;&#xFF0C;&#x7136;&#x540E;&#x548C;&#x8868;&#x683C;&#x5185;&#x5BB9;&#x5BF9;&#x5E94;&#x8D77;&#x6765;&#x3002;tableHeader&#x540C;&#x6837;&#x7684;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x5DF2;&#x7ECF;&#x5F97;&#x5230;&#x4E86;&#x8868;&#x5934;&#x6570;&#x636E;&#xFF0C;&#x5219;&#x4E0D;&#x9700;&#x8981;&#x5728;&#x89E3;&#x6790;&#x8868;&#x5934;&#x4E86;&#x3002;</p>
<p>&#x6CE8;&#x610F;&#xFF0C;&#x8FD9;&#x4E9B;&#x8868;&#x8FBE;&#x5F0F;&#x90FD;&#x662F;SipSoup&#x8BED;&#x6CD5;</p>
<h2 id=" tableevaluator"> TableEvaluator</h2>
<p>&#x8FD9;&#x4EE3;&#x8868;&#x8868;&#x683C;&#x62BD;&#x53D6;&#x5668;&#xFF0C;&#x4ED6;&#x662F;&#x4E00;&#x4E2A;&#x6A21;&#x578B;&#xFF0C;&#x63CF;&#x8FF0;&#x5982;&#x4F55;&#x62BD;&#x53D6;&#x8868;&#x683C;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x5C06;&#x5176;&#x8F6C;&#x5316;&#x4E3A;&#x5BF9;&#x8C61;&#x3002;&#x4ED6;&#x6709;&#x56DB;&#x79CD;&#x5F62;&#x5F0F;&#xFF0C;&#x5206;&#x522B;&#x662F;ListTableEvaluator</p>
<p> &#x3001;HorizontalPairTableEvaluator&#x3001;VerticalPairTableEvaluator&#x3001;CursorTableEvaluator&#x3002;</p>
<p>ListTableEvaluator&#xFF1A;&#x5217;&#x8868;&#x7C7B;&#x578B;&#x7684;&#x8868;&#x683C;&#xFF0C;&#x5B58;&#x5728;&#x8868;&#x5934;&#xFF0C;body&#x90E8;&#x5206;&#x6BCF;&#x4E00;&#x5217;&#x5BF9;&#x5E94;&#x4E00;&#x4E2A;&#x8868;&#x5934;&#xFF0C;&#x5217;&#x504F;&#x79FB;&#x4EE3;&#x8868;&#x5F53;&#x524D;&#x5217;&#x7684;&#x8BED;&#x4E49;</p>
<p>HorizontalPairTableEvaluator&#xFF1A;&#x6C34;&#x5E73;&#x7C7B;&#x578B;&#x8868;&#x683C;&#xFF0C;&#x7279;&#x70B9;&#x662F;&#x5DE6;&#x53F3;&#x4E92;&#x4E3A;key-value</p>
<p>VerticalPairTableEvaluator&#xFF1A;&#x5782;&#x76F4;&#x7C7B;&#x578B;&#x8868;&#x683C;&#xFF0C;&#x7279;&#x70B9;&#x662F;&#x4E0A;&#x4E0B;&#x4E92;&#x4E3A;key-value </p>
<p>CursorTableEvaluator:&#x57FA;&#x4E8E;&#x6E38;&#x6807;&#x904D;&#x5386;&#x7684;&#x6269;&#x5C55;&#x62BD;&#x53D6;&#xFF0C;&#x5F53;&#x524D;&#x7528;&#x5F97;&#x5F88;&#x5C11;&#xFF0C;&#x611F;&#x89C9;&#x5E94;&#x7528;&#x573A;&#x666F;&#x4E0D;&#x591A;</p>
<p>&#x6240;&#x6709;&#x7684;&#x62BD;&#x53D6;&#x5668;&#x90FD;&#x6709;&#x5982;&#x4E0B;&#x65B9;&#x6CD5;&#xFF1A;com.virjar.vscrawler.core.selector.table.TableEvaluator#evaluate&#x3001;com.virjar.vscrawler.core.selector.table.TableEvaluator#evaluateToMap&#x3001;com.virjar.vscrawler.core.selector.table.TableEvaluator#evaluateToJson</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="41sipsoup.html" class="navigation navigation-prev " aria-label="Previous page: 4.1SipSoup">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../5zhong-zi-guan-li-qi.html" class="navigation navigation-next " aria-label="Next page: 5.种子管理器">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"4.2TableEvaluator","level":"1.5.2","depth":2,"next":{"title":"5.种子管理器","level":"1.6","depth":1,"path":"5zhong-zi-guan-li-qi.md","ref":"5zhong-zi-guan-li-qi.md","articles":[]},"previous":{"title":"4.1SipSoup","level":"1.5.1","depth":2,"path":"4chou-qu-qi/41sipsoup.md","ref":"4chou-qu-qi/41sipsoup.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"4chou-qu-qi/42tableevaluator.md","mtime":"2017-06-24T15:45:00.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-06-25T14:04:12.299Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

